dbfilename = 'people-file'

ENDDB = 'enddb.'
ENDREC = 'endrec.'
RECSEP = '=>'


def storeDB(db, dbfilename=dbfilename):
    with open(dbfilename, 'w') as f:
        for key in db:
            print(key, file=f)
            for (name, value) in db[key].items():
                print(name+RECSEP, value, file=f)
            print(ENDREC, file=f)
        print(ENDDB, file=f)


def loadDB(dbfilename=dbfilename):
    with open(dbfilename, 'r') as f:
        import sys
        sys.stdin = f
        db = {}
        key = input()
        while key != ENDDB:
            rec = {}
            field = input()
            while field != ENDREC:
                name, value = field.split(RECSEP)
                rec[name] = value
                field = input()
            db[key] = rec
            key = input()
        return db


if __name__ == '__main__':
    from initdata import db
    storeDB(db)
